# -*- coding: utf-8 -*-
# © 2018 QYT Technology
# Authored by: Zhao Xingtao (zxt50330@gmail.com)

from bills.core.views import APIView

from bills.debt import debt
from bills.debt.models import Income, Expenditure, Budget
from bills.debt.schemas import BudgetCreateSchema, BudgetDetailSchema


class BudgetView(APIView):
    model = Budget
    serializer_detail_class = BudgetDetailSchema
    schema_mapping = {"create": BudgetCreateSchema}


debt.add_url_rule('/debt/budget/', view_func=BudgetView.as_view('budget'), methods=['POST',], endpoint='Budget_POST')
debt.add_url_rule('/debt/budget/<int:pk>', view_func=BudgetView.as_view('budget'), methods=['GET',], endpoint='Budget_GET')
